package com.cqfan.cloud.flow.launcher;

import com.cqfan.cloud.flow.core.ExecComp;
import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.flow.LiteflowResponse;
import com.yomahub.liteflow.parser.base.FlowParser;
import com.yomahub.liteflow.property.LiteflowConfig;
import com.yomahub.liteflow.slot.DefaultContext;
import com.yomahub.liteflow.thread.LiteFlowDefaultMainExecutorBuilder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;

import javax.annotation.Resource;

/**
 * @author JiaLing.Fan
 * @version 1.0
 * @date 2023/3/19 0:00
 * @description OpsApplication
 */

@SpringBootApplication(exclude = {
        DataSourceAutoConfiguration.class,
        MongoAutoConfiguration.class,
        MongoDataAutoConfiguration.class,
})
@ComponentScan(basePackages = {
        "com.yomahub.liteflow.*",
        "com.cqfan.*" })
@Slf4j
public class FlowApplication  implements CommandLineRunner {

    @Resource
    private ExecComp execComp;

    public static void main(String[] args) {
        SpringApplication.run(FlowApplication.class , args);
    }
    @Override
    public void run(String... args) throws Exception {
        execComp.testConfig();
    }
}